﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.DS
{
    public static partial class problem
    {
        public static Sql.DSProblem showDSProblem(int eid, int pid, out Sql.DSProblemStatistics ps, bool god)
        {
            var sql = new Sql.SqlDataContext();
            var p = sql.DSProblem.FirstOrDefault(row => row.eid == eid && row.pid == pid && (god || !row.disabled));
            ps = sql.DSProblemStatistics.FirstOrDefault(row => row.eid == eid && row.pid == pid);
            return p;
        }
    }
}
